package net.aiion.weave.impl.messaging;

import net.aiion.weave.spi.injection.annotations.Inject;
import net.aiion.weave.spi.messaging.MessageQueue;
import net.aiion.weave.spi.messaging.MessageService;
import net.aiion.weave.spi.naming.Context;
import net.aiion.weave.spi.naming.annotations.DynamicScoped;
import net.aiion.weave.spi.naming.annotations.Named;

@DynamicScoped
@Named
public class MessageServiceImpl implements MessageService
{
    @Inject
    private Context namingContext;

    public MessageServiceImpl() {
    }

    @Override
    public MessageQueue getQueue(final String queueName) {
        return new MessageQueueImpl(namingContext, queueName);
    }
}
